﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<HYBYSoft.Company.Models.Admin>" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <title>Index</title>
</head>
<link href="../../../../Content/admin_style.css" rel="stylesheet" type="text/css" />
<script src="../../../../Scripts/jquery-1.4.4.js" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.4.4.min.js") %>" type="text/javascript"></script>
<script src="../../../../Scripts/jquery-1.4.4-vsdoc.js" type="text/javascript"></script>
<script src="../../../../Scripts/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#Name").css("width", "140px").focus();
        $("#btnLogin").click(function () {
            var userName = $("#Name");
            var password = $("#Password");
            var flag = true;
            //验证用户名是否为空
            if (userName.val() == '') {
                userName.attr("style", "border:1px solid red; width:140px; background-color:#FFEEEE");
                flag = false;
            }
            //当不为空时，将样式取消
            $("#Name").keyup(function () {
                if (userName.val() != '') {
                    userName.removeAttr("style");
                    $("#Name").css("width", "140px");
                }
            });
            //验证密码是否为空
            if (password.val() == '') {
                password.attr("style", "border:1px solid red;width:140px; background-color:#FFEEEE");
                flag = false;
            }
            //当不为空时，将样式取消
            $("#Password").keyup(function () {
                if (password.val() != '') {
                    password.removeAttr("style");
                }
            });
            if (!flag)
                return false;
        });
        $("input[type='submit']").addClass("button");
    });
    $(function () {
        $("#btnLogin").click(function () {
            if ($("#txtValiCode").val() == "") {
                alert('验证码不能为空！');
                return false;
            }
        });
    });
   
</script>
<body>
    <div style="padding-top: 200px; text-align: center">
        <div id="login" style="width: 515px">
            <table border="0" cellpadding="0" cellspacing="0" width="515">
                <tr>
                    <td width="22px">
                    </td>
                    <td width="90px" style="background-image: url(../../../../Content/images/admin/head.gif);
                        height: 22px">
                    </td>
                    <td width="381px">
                    </td>
                    <td width="22px">
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../../../../Content/images/admin/t_01.gif); height: 68px">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/t_02.gif);">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/t_03.gif);" align="left">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: White;
                            font-size: large; font-weight: bold">管 理 员 登 录</span>
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/t_04.gif);">
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../../../../Content/images/admin/m_01.gif); height: 22px">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/m_02.gif);">
                    </td>
                    <td style="background: url(../../../../Content/images/admin/m_03.gif);">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/m_04.gif);">
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../../../../Content/images/admin/m_05.gif); height: 208px;">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/m_06.gif);" colspan="2">
                        <% using (Html.BeginForm())
                           { %>
                        <div>
                            <div id="errorDiv">
                                <%: Html.ValidationSummary(true) %></div>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td align="right" width="180">
                                        <%: Html.Label("Name") %>：
                                    </td>
                                    <td align="left">
                                        <%: Html.TextBoxFor(m => m.Name)%>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <%: Html.Label("Password") %>：
                                    </td>
                                    <td align="left">
                                        <%: Html.PasswordFor(m => m.Password)%>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        验证码：
                                    </td>
                                    <td align="left">
                                        <%:Html.TextBox("txtValiCode", null, new { Style = "width:140px" })%><img id="valiCode"
                                            style="cursor: pointer;" src="../Login/GetValidateCode" alt="验证码" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td align="left">
                                        <input id="btnLogin" type="submit" value="登录" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <% } %>
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/m_07.gif);">
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../../../../Content/images/admin/b_01.gif); height: 20px">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/b_02.gif);">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/b_03.gif);">
                    </td>
                    <td style="background-image: url(../../../../Content/images/admin/b_04.gif);">
                    </td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>
